<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>数组内值的总和</title>
	</head>
	<body>
		<script>
			var arr = [1,2,3,'i',4,'j',8];
			var num = 0;
			for(var i=0;i<arr.length;i++){
				if(typeof arr[i] == 'number'){
					console.log(arr[i]);
					num += arr[i];					
				}
			}
			console.log(num);
		</script>
	</body>
</html>
